#pragma once

#include <Ogre.h>


class Draw2DOverlay
{
private:
	Ogre::Overlay				*mImageOverlay;
	Ogre::OverlayContainer		*mImageContainer;
	Ogre::MaterialPtr			mMaterial;
	Ogre::TexturePtr			mTexture;
	static unsigned int			mCount;
	Ogre::Real					mOriginalWidth;
	Ogre::Real					mOriginalHeight;
public:
	Draw2DOverlay(void);
	~Draw2DOverlay(void);

	void LoadImage(const Ogre::String& filename, int zorder);
	void SetVisible(bool visible);
	void SetPosition(Ogre::Real left, Ogre::Real top, Ogre::Real width, Ogre::Real height)
	{
		mOriginalWidth = width;
		mOriginalHeight = height;
		mImageContainer->setWidth(width);
		mImageContainer->setHeight(height);		
		mImageContainer->setPosition(left, top);		
	};
	void SetWidthRatio(Ogre::Real ratio)
	{
		mImageContainer->setWidth(mOriginalWidth * ratio);
	};
	void SetHeightRatio(Ogre::Real ratio)
	{
		mImageContainer->setHeight(mOriginalHeight * ratio);
	};	
};
